package com.ruihai.tutorial.faceplusplus.rest;

import com.ruihai.tutorial.faceplusplus.service.FacePPService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Rest service for face++.
 * Created by Tim on 2017/11/8.
 */
@Controller
@CrossOrigin(origins = "*")
@RequestMapping("/services")
public class FacePPRestService {

    FacePPService service = new FacePPService();

    @RequestMapping(value = "/sendToCloud", method = RequestMethod.GET)
    public String sendImageToCloud(@RequestParam("imageData") byte[] imageData) {
        return service.faceDetectionService(imageData);
    }
}
